home *** CD-ROM | disk | FTP | other *** search
- '\"
- '\" Copyright (c) 1993 The Regents of the University of California.
- '\" Copyright (c) 1994 Sun Microsystems, Inc.
- '\"
- '\" See the file "license.terms" for information on usage and redistribution
- '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
- '\"
- '\" @(#) AppInit.3 1.3 94/12/17 16:17:06
- '\"
- .so man.macros
- .HS Tcl_AppInit tclc 7.0
- .BS
- .SH NAME
- Tcl_AppInit \- Perform application-specific initialization
- .SH SYNOPSIS
- .nf
- \fB#include <tcl.h>\fR
- .sp
- \fBTcl_AppInit\fR(\fIinterp\fR)
- .SH ARGUMENTS
- .AS Tcl_Interp *interp
- .AP Tcl_Interp *interp in
- Interpreter for the application.
- .BE
-
- .SH DESCRIPTION
- .PP
- \fBTcl_AppInit\fR is a procedure that is invoked by the main programs
- for Tcl applications such as \fBtclsh\fR and \fBwish\fR.
- Its purpose is to allow new Tcl applications to be created without
- modifying existing main programs such as those for \fBtclsh\fR
- and \fBwish\fR.
- To create a new application simply write a new version of
- \fBTcl_AppInit\fR to replace the default version provided by Tcl,
- then link your new \fBTcl_AppInit\fR with the Tcl library, which
- contains the main program from \fBtclsh\fR (be sure to specify the
- switch ``\fB\-u _main\fR'' to the linker to force it to use the
- version of \fBmain\fR from the Tcl library).
- .PP
- \fBTcl_AppInit\fR is invoked after other initialization in
- \fBmain\fR and before entering the main loop to process commands.
- Here are some examples of things that \fBTcl_AppInit\fR might do:
- .IP [1]
- Call initialization procedures for various packages used by
- the application.
- Each initialization procedure adds new commands to \fIinterp\fR
- for its package and performs other package-specific initialization.
- .IP [2]
- Process command-line arguments, which can be accessed from the
- Tcl variables \fBargv\fR and \fBargv0\fR in \fIinterp\fR.
- .IP [3]
- Invoke a startup script to initialize the application.
-
- .SH KEYWORDS
- application, argument, command, initialization, interpreter
-